package com.lvtulife.paas.gtd.service.impl;

import com.lvtulife.common.bean.DelVo;
import com.lvtulife.common.component.easyui.Tree;
import com.lvtulife.common.component.exception.ErrMsg;
import com.lvtulife.paas.gtd.bean.AimBranchVo;
import org.springframework.stereotype.Service;

import com.lvtulife.paas.gtd.mapper.GtdAimBranchMapper;
import com.lvtulife.paas.gtd.entity.GtdAimBranch;
import com.lvtulife.paas.gtd.service.GtdAimBranchServiceI;
import com.lvtulife.common.service.impl.BaseServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;

import java.util.Date;
import java.util.List;

/**
 * GtdAimBranch 表数据服务层接口实现类
 */
@Service
public class GtdAimBranchServiceImpl extends BaseServiceImpl<GtdAimBranchMapper, GtdAimBranch> implements GtdAimBranchServiceI {


    @Override
    public Long saveBranchAim(AimBranchVo vo) {
        return null;
    }

    @Override
    public void setParentBranchAim(Long id, Long parentId) {

    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void sortBranchAim(Long id, Integer sort) {
        GtdAimBranch entity = selectById(id);
        Assert.notNull(entity, ErrMsg.NO_OBJECT.getMsg());

        entity.setSort(sort == null || sort <= 0 ? 1 : sort);
        entity.setUpdatedDt(new Date());
        if (!updateById(entity)) {
            throw new RuntimeException(ErrMsg.OPERATION_FAILURE.getMsg());
        }
    }

    @Override
    public void delBranchAim(DelVo vo) {

    }

    @Override
    public List<AimBranchVo> findSonBranchAims(Long pid) {
        return null;
    }

    @Override
    public List<AimBranchVo> findTypeBranchAims(Long userId, Long typeId) {
        return null;
    }

    @Override
    public List<AimBranchVo> findLikeBranchAims(Long userId, String likeStr) {
        return null;
    }

    @Override
    public AimBranchVo getBranchAim(Long id) {
        return null;
    }

    @Override
    public List<AimBranchVo> getFullBranchAims(Long id) {
        return null;
    }

    @Override
    public Tree getTreeBranchAims(Long id) {
        return null;
    }
}